With recent early access releases of [JDK9](https://jdk9.java.net/download/) (e.g.
9-ea+113), the XML plugin crashes on plugin startup:
~~~~
java.lang.IllegalStateException: Already connected
at java.net.URLConnection.checkConnected(java.base@9-ea/URLConnection.java:1816)
at java.net.URLConnection.setUseCaches(java.base@9-ea/URLConnection.java:993)
at java.util.ServiceLoader.parse(java.base@9-ea/ServiceLoader.java:454)
...
at javax.xml.parsers.FactoryFinder.findServiceProvider(java.xml@9-ea/FactoryFinder.java:289)
...
at org.apache.xml.resolver.Catalog.setupReaders(Catalog.java:399)
at xml.Resolver.load(Resolver.java:270)
...
at xml.XmlPlugin.start(XmlPlugin.java:54)
...
~~~~
| Submitted | will69 - 2016-04-11 10:28:24.912000 | Assigned | kerik-sf |
|---|---|---|---|
| Priority | 5 | Labels | JDK9 XML |
| Status | open | Group | None |
| Resolution | None |
| 2016-04-11 10:42:56.460000 will69 |
XML plugin startup initializes the internal jEdit XML resolver. That in turn triggers
the URL stream handler for "jeditresource:" URLs. And that returns an already connected
URLConnection in its [openConnection() method](https://sourceforge.net/p/jedit/svn/HEAD/tree/jEdit/trunk/org/gjt/sp/jedit/proto/jeditresource/Handler.java#l46).
The subsequent call to [setUseCaches()](http://hg.openjdk.java.net/jdk9/dev/jdk/file/550572253bd8/src/java.base/share/classes/java/net/URLConnection.java#l993)
on that URLConnection throws the [IllegalStateException](http://hg.openjdk.java.net/jdk9/dev/jdk/file/550572253bd8/src/java.base/share/classes/java/net/URLConnection.java#l1816)
when it finds that the URLConnection is already connected.
|
|---|---|
| 2016-04-25 10:41:45.457000 will69 |
Just to be perfectly clear: This is a bug and it has been for 17 years. The only thing this has to do with Java 9 is that Java 9 tells you so. Would some kind soul please take the offending line out? |